#include<iostream>
#include<signal.h>
#include<unistd.h>

using namespace std;

void handler(int signum)
{
    cout<<"...git sig :"<<signum<<endl;
    int n=alarm(5);
    cout<<"剩余时间："<<n<<endl;
}

int main()
{
    signal(14,handler);
    int n=alarm(50);
    while(true)
    {
        cout<<"wite time"<<endl;
        cout<<"process pid is :"<<getpid()<<endl;
        sleep(1);
    }


    return 0;
}